package com.yiyahui.project.erp.service.impl;

import java.util.List;
import com.yiyahui.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiyahui.project.erp.mapper.YiyaPlanMapper;
import com.yiyahui.project.erp.domain.YiyaPlan;
import com.yiyahui.project.erp.service.IYiyaPlanService;

/**
 * 排班Service业务层处理
 * 
 * @author yiyahui
 * @date 2020-05-16
 */
@Service
public class YiyaPlanServiceImpl implements IYiyaPlanService 
{
    @Autowired
    private YiyaPlanMapper yiyaPlanMapper;

    /**
     * 查询排班
     * 
     * @param id 排班ID
     * @return 排班
     */
    @Override
    public YiyaPlan selectYiyaPlanById(Long id)
    {
        return yiyaPlanMapper.selectYiyaPlanById(id);
    }

    /**
     * 查询排班列表
     * 
     * @param yiyaPlan 排班
     * @return 排班
     */
    @Override
    public List<YiyaPlan> selectYiyaPlanList(YiyaPlan yiyaPlan)
    {
        return yiyaPlanMapper.selectYiyaPlanList(yiyaPlan);
    }

    /**
     * 新增排班
     * 
     * @param yiyaPlan 排班
     * @return 结果
     */
    @Override
    public int insertYiyaPlan(YiyaPlan yiyaPlan)
    {
        yiyaPlan.setCreateTime(DateUtils.getNowDate());
        return yiyaPlanMapper.insertYiyaPlan(yiyaPlan);
    }

    /**
     * 修改排班
     * 
     * @param yiyaPlan 排班
     * @return 结果
     */
    @Override
    public int updateYiyaPlan(YiyaPlan yiyaPlan)
    {
        yiyaPlan.setUpdateTime(DateUtils.getNowDate());
        return yiyaPlanMapper.updateYiyaPlan(yiyaPlan);
    }

    /**
     * 批量删除排班
     * 
     * @param ids 需要删除的排班ID
     * @return 结果
     */
    @Override
    public int deleteYiyaPlanByIds(Long[] ids)
    {
        return yiyaPlanMapper.deleteYiyaPlanByIds(ids);
    }

    /**
     * 删除排班信息
     * 
     * @param id 排班ID
     * @return 结果
     */
    @Override
    public int deleteYiyaPlanById(Long id)
    {
        return yiyaPlanMapper.deleteYiyaPlanById(id);
    }
}
